﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ParkingLot.Utility
{
    public class TreeConverterHelp
    {
        

        /// <summary>
        ///  从NodeID-ParentID形式的节点 获取目标节点的所有孩子
        /// </summary>
        /// <param name="value">节点ID</param>
        /// <param name="dictNodeWithParent">NodeID-ParentID形式的节点</param>
        /// <returns></returns>
        public static List<int> GetChildrens(int value, Dictionary<int, int> dictNodeWithParent)
        {
            List<int> lisChildren=new List<int>();
            foreach (var  nodeID in dictNodeWithParent.Keys)
            {
                if (dictNodeWithParent[nodeID] == value)
                {
                    lisChildren.Add(nodeID);
                }
            }
            return lisChildren;
        }


     
    }
}
